home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 2000 February
/
Macworld (2000-02).dmg
/
Shareware World
/
Comms & Internet
/
Flex-Able 1.0
/
.admin
/
rotate.able
< prev
Wrap
Text File
|
1999-12-07
|
4KB
|
155 lines
<:set banners <:use_settings "/.admin/banners">>
<:set form <:read_form>>
<!-- authorization first -->
<:set admin <:use_settings "/.admin/pass">>
<:ifequal env["REMOTE_PASSWORD"] admin[env["REMOTE_USER"]]>
<:set ok 1>
<:else>
<:set ok 0>
<:request_credentials "SITE_ADMIN">
<:/ifequal>
<!-- form data
<:foreach name value form>
<:echo name " = " value>
<:/foreach>
-->
<html>
<head>
<link rel=stylesheet type="text/css" HREF="faadmin.css">
<title>Flex-Able: Admin: Counters</title>
</head>
<body>
<:ifequal ok 1>
<:set groupname <:url_decode env["QUERY_STRING"]>>
<:require groupname>
<:set current_group banners[groupname]>
<:set this_url <:cat "rotate.able?" <:url_encode groupname>>>
<:else>
<:set this_url "rotate.able">
<:/require>
<:require current_group>
<!-- Banner Item Management -->
<:require form["action"]>
<:ifequal form["action"] "Delete">
<:set current_group[form["index"]]>
<:else>
<:set current_group[form["index"]]>
<:set current_group[form["index"]] form["value"]>
<:/ifequal>
<:save_settings "/.admin/banners">
<:/require>
<!-- sample -->
<a href="rotate.able">Back to the group list</a><hr><P>
<h2>Sample item from <:echo groupname></h2>
<blockquote>
<table border=1><tr><td><:rotate current_group></td></tr></table>
<a href=<:echo this_url>>Refresh</a><P>
To use this set in a web page, use the following HTML:
<ul>
<:set banners <:use_settings "/.admin/banners">> (near the begining of the page)
<br><:rotate banners["<:echo groupname>"]> (where you want the data to be inserted)
</ul>
</blockquote>
<h2>Contents of <:echo groupname></h2>
<blockquote>
<table border=1>
<tr>
<th></th>
<th>Item</th>
<th>Delete</th>
</tr>
<:foreach index value current_group><tr>
<form action=<:echo this_url> method=post>
<td></td>
<td><textarea rows=5 cols=40 name="value"><:echo value></textarea></td>
<td><input type=hidden name=index value="<:echo index>">
<input type=submit name="action" value="Change">
<input type=submit name="action" value="Delete"></td>
</form>
</tr><:/foreach>
<tr>
<form action=<:echo this_url> method=post>
<th>Add...</th>
<td><textarea rows=5 cols=40 name="value"></textarea></td>
<td><input type=hidden name=index value="1000">
<input type=submit name="action" value="Add"></td>
</form>
</tr>
</table>
<input type=submit value="Save Changes">
</form></blockquote>
<:else>
<!-- Banner Group Management -->
<:require form["$newgroup"]>
<!-- Create new group <:echo form["$newgroup"]> -->
<:set banners[form["$newgroup"]] <:new "LIST">>
<:/require>
<:require form["$delete"]>
<:foreach index value form["$delete"]>
<:set banners[value]>
<:/foreach>
<:/require>
<form action=rotate.able method=POST>
<table bgcolor="#e8e8e8" border=1>
<tr>
<th></th>
<th>Group Name</th>
<th>Items</th>
<th>Delete</th>
</tr>
<:foreach name value banners><tr>
<th></th>
<td><a href="rotate.able?<:url_encode name>"><:echo name></a></td>
<td><:size_of value></td>
<td><input type=checkbox name="$delete" value="<:echo name>"></td>
</tr>
<:/foreach>
<tr>
<th>New...</th>
<td><input type=text name="$newgroup" size=20></td>
<td></td>
<td></td>
</tr>
</table>
<input type=submit value="Save Changes">
</form>
<:/require>
<:else>
<!-- not authorized -->
<DIV CLASS="topic">You do not have permission to view or change the banner data.</DIV>
<:/ifequal>
<hr>
<A HREF="default.html" CLASS="back">back to Admin Home</A>
</body>
</html>